#include <iostream>
#include <cstring>
#include <vector>
#include "ergodic/ergodic.h"
using namespace std;



int main() {

    //BTree A;
    //vector<int> treeNode = {1,2,3,4,5,6};
    //创建二叉树
//    BTree root=new Node(0);
//    BTree a = new Node(1);
//    BTree b = new Node(2);
//    BTree c = new Node(3);
//    BTree d = new Node(4);
//    BTree e = new Node(5);
//    BTree f = new Node(6);



//    root->left  = a;
//    root->right = b;
//    a->left = c ;
//    a->right = d;
//    b->left = e;
//    b->right = f;

    ergodic test;

    /*                       1   二叉树的结构
     *                     /   \
     *                    2     3
     *                  /  \   / \
                       4    5  6  7
                     /  \
                     8   9

     */
    vector<int> nums={1,2,3,4,5,6,7,8,9};
    BTree root = test.make_a_tree(nums);
    cout<<"前序遍历"<<endl;
    test.front_bianli(root);
    cout<<endl;
    cout<<"前序遍历1"<<endl;
    test.front_bianli1(root);
    cout<<endl;
    cout<<"前序遍历2"<<endl;
    test.front_bianli2(root);
    cout<<endl;
    cout<<"中序遍历"<<endl;
    test.inorder_traversal(root);
    cout<<endl;
    cout<<"中序遍历1"<<endl;
    test.inorder_traversal1(root);
    cout<<endl;
    cout<<"后序遍历"<<endl;
    test.back_travelsal(root);
    cout<<endl;
    cout<<"后序遍历1"<<endl;
    test.back_travelsal1(root);
    cout<<endl;
    cout<<"层序遍历"<<endl;
    test.sequence_traversal(root);
    return 0;
}
